/*
给定一个大小为
n
n的数组
a
a，请你判断一个数组是否满足以下条件：
1.数组满足升序
2.数组之差构成的数组满足降序
*/


let n = parseInt(readline());
const array1 = readline().split(' ').map(Number);
const array2 = []
let flag = 1;
for (let i = 0; i < n - 1; i++) {
    if (array1[i + 1] - array1[i] <= 0) {
        flag = 0;
        break;
    }
    array2.push(array1[i + 1] - array1[i]);
}
for (let i = 0; i < n - 2; i++) {
    if (array2[i + 1] - array2[i] >= 0) {
        flag = 0;
        break;
    }
}
if (flag === 0) {
    console.log("No");
}
else {
    console.log("Yes");
}
/*
package hot100;

import java.util.Scanner;
import java.util.ArrayList;

public class Main {
    public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] a = new int[n];
        int flag = 1;
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        ArrayList<Integer> b = new ArrayList<Integer>();
        for (int i = 0; i < n - 1; i++) {
            int temp = a[i + 1] - a[i];
            if (temp <= 0) {
                flag = 0;
                break;
            }
            b.add(temp);
        }
        for (int i = 0; i < n - 2; i++) {
            if (b.get(i + 1) >= b.get(i)) {
                flag = 0;
                break;
            }
        }
        if (flag == 0) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
        in.close();
    }
}
*/

